package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class FileoutputStreamTest {
    public static void main(String[] args) {
        OutputStream fileOutputStream=null;
        try {
            fileOutputStream = new FileOutputStream("d:/2",false);
            byte[] bytes = new String("你好啊").getBytes(StandardCharsets.UTF_8);
            fileOutputStream.write(bytes,0,bytes.length);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
